<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
  //Demo
  layui.use(['layer','jquery','form','element','table'], function () {
      // 操作对象
      var layer = layui.layer,$ = layui.jquery,form = layui.form, element = layui.element,table = layui.table;

    // 提交
    form.on('submit(upbtn)', function (data) {
      // 提交到方法 默认为本身
      $.post("{:url('/admin/config/edit')}",data.field,function(res){
        if(res.code ==  1){
          layer.msg(res.msg,{time:1800},function(){
              location.reload();
          });
        }else{
          layer.msg(res.msg,{time:1800});
        }
      });
      return false;
    });
  });
</script>